import request from "../request";

export function queryTreat(data) {
    return request({
        url: "car/fault/v/treat/query?pageSize=" + data.pageSize + "&pageNumber=" + data.pageNumber,
        method: "post",
        data: data
    });
}

export function treatDetail(data) {
    return request({
        url: "car/fault/v/treat/detail",
        method: "post",
        data: data
    });
}

export function queryHistoryTreat(data) {
    return request({
        url: "car/fault/v/treat/history/query?pageSize=" + data.pageSize + "&pageNumber=" + data.pageNumber,
        method: "post",
        data: data
    });
}

export function showGraph(data) {
    return request({
        url: "car/fault/v/treat/knowledge/show",
        method: "post",
        data: data
    });
}

// tags
// edges
// {
//   "showName": "Tags"
// }
export function showNebula(data) {
    return request({
        url: "car/nebula/v/show",
        method: "post",
        data: data
    });
}

/**
 * {
 *   "propertyList": {},
 *   "tagName": "string",
 *   "vid": "string"
 * }
 *
 * @param data
 * @returns {*}
 */
export function insertTag(data) {
    return request({
        url: "car/nebula/v/tag/insert",
        method: "post",
        data: data
    });
}

// {"tagName": ""}
export function showTags(data) {
  return request({
    url: "car/nebula/v/showTags",
    method: "post",
    data: data
  });
}

/**
 * {
 *   "edgeName": "string",
 *   "endVID": "string",
 *   "propertyList": {},
 *   "startVID": "string"
 * }
 * @param data
 * @returns {*}
 */
export function insertEdge(data) {
  return request({
    url: "car/nebula/v/edge/insert",
    method: "post",
    data: data
  });
}

export function showTagProperty(data) {
  return request({
    url: "car/nebula/v/tag/upt/list?tagName=" + data,
    method: "get",
    data: data
  });
}

export function addTag(data) {
  return request({
    url: "car/nebula/v/tag/add",
    method: "post",
    data: data
  });
}

export function delTag(data) {
  return request({
    url: "car/nebula/v/tag/del?tagName=" + data,
    method: "delete",
    data: data
  });
}

export function uptTagProp(data) {
  return request({
    url: "car/nebula/v/tag/upt/change",
    method: "post",
    data: data
  });
}

export function delTagProp(data) {
  return request({
    url: "car/nebula/v/tag/upt/drop",
    method: "post",
    data: data
  });
}

export function addTagProp(data) {
  return request({
    url: "car/nebula/v/tag/upt/add",
    method: "post",
    data: data
  });
}

export function patchTreatDetail(data) {
  return request({
    url: "car/fault/v/treat/detail",
    method: "patch",
    data: data
  });
}

export function queryFaultClass() {
  return request({
    url: "car/fault/v/treat/class/query",
    method: "get"
  });
}

export function exportTag() {
  return request({
    url: "car/nebula/v/tag/export",
    method: "get",
    responseType: "blob"
  });
}

export function importTag(data) {
    return request({
        url: "car/nebula/v/tag/import",
        method: "post",
        data: data
    });
}

export function exportGraph() {
    return request({
        url: "car/nebula/v/export",
        method: "get",
        responseType: "blob"
    });
}

export function importGraph(data) {
    return request({
        url: "car/nebula/v/import",
        method: "post",
        data: data
    });
}
